#!/usr/bin/ruby
require 'rexml/document'
require 'rexml/streamlistener'
include REXML

file = ARGV[0]

class Traduce
  include StreamListener

  def initialize()
    @tag_a_traducir 
    @escribe = false
  end
	
	def tag_start(name, attributes)
		if(name == "micasa")
			@tag_a_traducir = "myhouse"
			puts "<"+@tag_a_traducir+">"
		end
		if(name == "habitacion")
			@tag_a_traducir = "room"
			puts "<"+@tag_a_traducir+">"
		end
		if(name == "mueble")
			@tag_a_traducir = "furniture"
			puts "<"+@tag_a_traducir+">"
		end
		if(name == "puerta")
			@tag_a_traducir = "door"
			puts "<"+@tag_a_traducir+">"
		end
	end  

end

listener = Traduce.new()
parser = Parsers::StreamParser.new(File.new(file), listener)
parser.parse

